﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace testTennis
{
    /// <summary>
    /// Summary description for TestMatch
    /// </summary>
    [TestClass]
    public class TestMatch
    {
        Match m;
        int setP1, setP2;

        public TestMatch()
        {
            m=new Match();
        }

        [TestMethod]
        public void tao_Match()
        {
            Assert.AreEqual(m.setP1, 0);
            Assert.AreEqual(m.setP2, 0);
        }

        [TestMethod]
        public void P1_win_1_0()
        {
            m.setP1 = 0;
            m.setP2 = 0;
            m.set.result = "P1";
            m.increaseSet();
            Assert.AreEqual(m.setP1,1);
          
        }

        [TestMethod]
        public void P2_win_1_0()
        {
            m.setP1 = 0;
            m.setP2 = 0;
            m.set.result = "P2";
            m.increaseSet();
            Assert.AreEqual(m.setP2, 1);

        }

        [TestMethod]
        public void P1_equal_P2_1_1()
        {
            m.setP1 = 0;
            m.setP2 = 0;
            m.set.result = "P1";
            m.increaseSet();
            Assert.AreEqual(m.setP1, 1);

        }

        [TestMethod]
        public void P1_equall_P2_1_1()
        {
            m.setP1 = 0;
            m.setP2 = 0;
            m.set.result = "P2";
            m.increaseSet();
            Assert.AreEqual(m.setP2, 1);

        }

        [TestMethod]
        public void P1_win_2_1()
        {
            m.setP1 = 1;
            m.setP2 = 1;
            m.set.result = "P1";
            m.increaseSet();
            Assert.AreEqual(m.setP1, 2);

        }

        [TestMethod]
        public void P2_win_2_1()
        {
            m.setP1 = 1;
            m.setP2 = 1;
            m.set.result = "P2";
            m.increaseSet();
            Assert.AreEqual(m.setP2, 2);

        }
        


       
    }
}
